#!/usr/bin/evn python
# -*- coding: UTF-8 -*-
# @File: gototask_page.py
# @Author: fy
# @date: 2021/10/21 15:07
from pages.base_page import BasePage
from appium.webdriver.common.mobileby import MobileBy
from time import sleep

class GotoTaskPage(BasePage):
    '''
    做任务赚喵糖页面
    '''
    def click_gototask(self):
        '''
        点击 去浏览 按钮
        :return:
        '''
        # 只有第一个去完成对应的浏览天猫有页面的跳转
        # goto_tianmao_locator= (MobileBy.XPATH, '//*[contains(@text, "去完成")]')
        # ele = self.find_element(goto_tianmao_locator)
        # ele.click()
        # sleep(16)
        # self.back()

        for i in range(10):
            gototask_locator = (MobileBy.XPATH, '//*[contains(@text, "去浏览")]')
            ele = self.find_element(gototask_locator)
            print(ele)
            ele.click()
            sleep(15)
            self.back()






